Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend csplib to add Azure SQL Database #1278

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Conversation

rgeyer
Copy link
Contributor

@rgeyer rgeyer commented Jul 11, 2024

Adds an azure sql database dashboard to csp-mixin.

image

image

@rgeyer rgeyer force-pushed the rgeyer/csp-azuresql-actually branch from 075775a to 8a6e346 Compare July 24, 2024 21:40
@rgeyer rgeyer force-pushed the rgeyer/csp-azuresql-actually branch from 8a6e346 to 720fc62 Compare July 24, 2024 21:46
@rgeyer rgeyer marked this pull request as ready for review July 24, 2024 21:47
@rgeyer rgeyer requested a review from a team as a code owner July 24, 2024 21:47
Comment on lines +367 to +385
asql_dtutbl:
this.signals.azuresqldb.dtuUsed.common
+ commonlib.panels.generic.table.base.new(
'DTU utilization and limits by database',
[
this.signals.azuresqldb.dtuUsed.asTarget()
+ g.query.prometheus.withFormat('table')
+ g.query.prometheus.withInstant(true),

this.signals.azuresqldb.dtuPercent.asTarget()
+ g.query.prometheus.withFormat('table')
+ g.query.prometheus.withInstant(true),

this.signals.azuresqldb.dtuLimit.asTarget()
+ g.query.prometheus.withFormat('table')
+ g.query.prometheus.withInstant(true),
],
'DTU utilization and limits by database'
) + self._asql_tableCommon(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could also try to define tables with using asTable() and asTableColumn() now:
#1290

Comment on lines 63 to 74
vCoreCpuPercent: {
name: 'vCore utilization by database',
description: 'Percent of CPU utilization by database. If database uses vCores, the vCore percent utilization is shown',
type: 'gauge',
unit: 'percent',
sources: {
azuremonitor: {
expr: '100 * (label_replace(azure_microsoft_sql_servers_databases_cpu_used_average_count{%(queriesSelector)s}, "database", "$1", "resourceID", ".+/(.*)") / label_replace(azure_microsoft_sql_servers_databases_cpu_limit_average_count{%(queriesSelector)s}, "database", "$1", "resourceID", ".+/(.*)"))',
legendCustomTemplate: '{{database}} vCore',
},
},
},
Copy link
Contributor

@v-zhuravlev v-zhuravlev Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type=gauge and aggLevel=none is equivalent of type=raw. Right now it would be just fine, however, changing aggLevel to instance/group later on would break this signal, as 100 * would be applied in the wrong place.
Best to change type to raw, or move 100 * to exprWrappers:
https://github.com/grafana/jsonnet-libs/tree/master/common-lib/common/signal#configuration-options

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh excellent. Thank you for this, I'll add it to the exprWrappers.

@rgeyer rgeyer merged commit aa29d29 into master Jul 26, 2024
3 checks passed
@rgeyer rgeyer deleted the rgeyer/csp-azuresql-actually branch July 26, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants